package com.jsn.responseEntity;

public enum  CommonCode implements ResultCode {

	//基础错误 1----
	COMMON_FAIL(false, -1, "操作失败"),
	INVALID_PARAM(false, 10001, "非法参数"),
	VERIFICATION_CODE_ERROR(false, 10002, "验证码错误"),
	VERIFICATION_CODE_EXPIRED(false, 10003, "验证码过期请重新获取"),
	ACCESS_LIMIT(false, 40004, "访问频繁,请稍后再试"),


 	//认证 4----
	UNAUTHORIZED_ERROR(false, 40003, "权限不足！"),
	VERIFICATION_PARAM_IS_NULL(false, 40004, "验证码不可以为空"),
	CAPTCHA_TOKEN_IS_NULL(false, 40005, "验证码令牌不可以为空"),
	USER_NAME_ALREADY_EXISTS(false, 40006, "用户名已经存在"),
	USER_PASSWORD_IS_ERROR(false, 40007, "密码不正确"),
	INVALID_TOKEN(false, 40008, "身份认证失败!"),




	SERVER_ERROR(false, 99999, "服务器开小差了 请稍后再试");



	boolean success;
	//操作代码
	int code;
	//提示信息
	String message;


   CommonCode(boolean success, int code, String message){
		this.success = success;
		this.code = code;
		this.message = message;
	}
	@Override
	public boolean success() {
		return success;
	}

	@Override
	public int code() {
		return code;
	}

	@Override
	public String message() {
		return message;
	}
}
